import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/hello")
public class helloServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //这行代码要注释掉，不能调用父类的doget
       // super.doGet(req, resp);

        //这个是让服务器在自己的控制台打印
        System.out.println("hello  hello");
        //在页面上也打印 hello world，把hello world字符串，放到http响应的body中，浏览器就会把body的内容显示到页面上
        resp.getWriter().write("hello  hello");

    }
}
